<?php

use yii\helpers\Url;

/**
 * @var $this \yii\web\View
 * @var $agent \app\models\Agent
 */

$agent = Yii::$app->get('agent')->identity;
?>

<div id="navbar" class="navbar navbar-default navbar-fixed-top">

    <div class="navbar-container" id="navbar-container">
        <button type="button" class="navbar-toggle menu-toggler pull-left" id="menu-toggler" data-target="#sidebar">
            <span class="sr-only"><?= Yii::t('app', 'Toggle sidebar') ?></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </button>
        <div class="navbar-header pull-left">
            <a href="<?php echo Url::to(['/agent']); ?>" class="navbar-brand">
                <small>
                    <i class="fa fa-leaf"></i>
                    <?php echo Yii::$app->params['appName'], '代理商管理后台'; ?>
                </small>
            </a>
        </div>

        <div class="navbar-buttons navbar-header pull-right" role="navigation">
            <ul class="nav ace-nav">

                <li class="light-blue">
                    <a data-toggle="dropdown" href="#" class="dropdown-toggle">
                        <span class="user-info">
                            <small>当前登录</small> <?= $agent->username ?>
                        </span>
                        <i class="ace-icon fa fa-caret-down"></i>

                    </a>
                    <ul class="user-menu dropdown-menu-right dropdown-menu dropdown-yellow dropdown-caret dropdown-close">
                        <li>
                            <a href="<?= \yii\helpers\Url::to(['/agent/identity/profile']) ?>"><i
                                        class="ace-icon fa fa-user"></i> 用户设置</a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a href="<?= \yii\helpers\Url::to(['/agent/identity/logout']) ?>" data-method="post"><i
                                        class="ace-icon fa fa-power-off"></i> 退出</a>
                        </li>
                    </ul>

                </li>
            </ul>
        </div>
    </div>
</div>